package cn.itcast.mapper;

import cn.BootDemoApplication;
import cn.itcast.pojo.*;
import cn.itcast.service.UserService;
import cn.itcast.util.CommonUtil;
import cn.itcast.util.DBUtils;
import cn.itcast.util.ExpressServiceCodeEnum;
import cn.itcast.util.TraceScri;
import cn.message.service.IRoleService;
import cn.web.web_module.entity.*;
import cn.web.web_module.mapper.BusinessDataMapper;
import cn.web.web_module.mapper.WebModuleMapper;
import cn.web.web_module.mapper.WithdrawRechargeInfoMapper;
import cn.web.web_module.service.RechargeService;
import cn.web.web_module.service.RoleModuleService;
import cn.web.web_module.service.UserBindHorsemanService;
import cn.web.web_module.service.impl.*;
import cn.web.web_module.util.MyUtil;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.metadata.Sheet;
import com.alibaba.excel.metadata.Table;

import com.alibaba.fastjson.JSON;
import com.sf.csim.express.service.CallExpressServiceTools;
import com.sf.csim.express.service.HttpClientUtil;
import com.sf.csim.express.service.IServiceCodeStandard;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
import me.chanjar.weixin.mp.bean.template.WxMpTemplateData;
import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import org.apache.logging.log4j.util.Strings;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

import org.springframework.boot.test.context.SpringBootTest;

import org.springframework.core.io.ClassPathResource;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.ResourceUtils;

import javax.annotation.Resource;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.time.LocalDate;
import java.util.*;
import org.springframework.http.ResponseEntity;

/**
 * @Author: 欧阳辉
 * @Description:
 * @Date: Created in 11:15 2020/6/19
 * @Modified By:
 */

@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = BootDemoApplication.class)
@Slf4j
public class SpringBootTestMethod {

    @Resource
    private RoleModuleService roleModuleService;

    @Resource
    private WebModuleMapper webModuleMapper;

    @Resource
    private IRoleService roleService;

    @Resource
    private UserService userService;

    @Resource
    private userMapper userMapper;

    @Resource
    private earningsMapper earningsMapper;

    @Resource
    private StringRedisTemplate stringRedisTemplate;

    @Resource
    private AutomaticSendImpl automaticSend;

    @Resource
    private orderMapper orderMappers;

    @Resource
    private orderItemMapper orderItemMapper;

    @Resource
    private LogOrRegisterServiceImpl logOrRegisterService;


    @Resource
    private AdminRelevantImpl adminRelevant;

    @Resource
    private BusinessDataMapper businessDataMapper;

    @Resource
    private BusinessDataServiceImpl businessDataService;

    @Resource
    private horsemanMapper horsemanMapper;

    @Resource
    private orderItemMapper orderitemMapper;

    @Resource
    private infoMapper infoMapper;

    @Resource
    private BusinessDataServiceImpl businessDataServiceimpl;

    @Resource
    private UserBindHorsemanService userBindHorsemanService;

    @Resource
    private gzhMapper gzhMapper;

    @Resource
    private RechargeService rechargeService;

    @Resource
    private rechargeMapper rechargeMapper;


    @Resource
    private WithdrawRechargeInfoMapper withdrawRechargeInfoMapper;


    @Resource
    private districtMapper districtMapper;


    @Resource
    private RabbitTemplate rabbitTemplate;

    @Resource
    private GetRecyclableDeductImpl getRecyclableDeduct;

    @Resource
    private packageOrderItemMapper packageOrderItemMapper;

    @Test
    public void testmapp() {
        // 文件输出位置
        String outPath = "D:\\test.xlsx";

        try {
            // 所有行的集合
            List<List<Object>> list = new ArrayList<List<Object>>();

            for (int i = 1; i <= 10; i++) {
                // 第 n 行的数据
                List<Object> row = new ArrayList<Object>();
                row.add("第" + i + "单元格");
                row.add("第" + i + 1 + "单元格");
                list.add(row);
            }

            ExcelWriter excelWriter = EasyExcelFactory.getWriter(new FileOutputStream(outPath));
            // 表单
            Sheet sheet = new Sheet(1, 0);
            sheet.setSheetName("第一个Sheet");
            // 创建一个表格
            Table table = new Table(1);
            // 动态添加 表头 headList --> 所有表头行集合
            List<List<String>> headList = new ArrayList<List<String>>();
            // 第 n 行 的表头
            List<String> headTitle0 = new ArrayList<String>();
            List<String> headTitle1 = new ArrayList<String>();
            List<String> headTitle2 = new ArrayList<String>();
            headTitle0.add("最顶部-1");
            headTitle0.add("标题1");
            headTitle1.add("最顶部-1");
            headTitle1.add("标题2");
            headTitle2.add("最顶部-1");
            headTitle2.add("标题3");

            headList.add(headTitle0);
            headList.add(headTitle1);
            headList.add(headTitle2);
            table.setHead(headList);

            excelWriter.write1(list, sheet, table);
            // 记得 释放资源
            excelWriter.finish();
            System.out.println("ok");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }

    }

    @Test
    public void testOrder() {
        List<HorsemanContrast> horsemanContrasts = businessDataServiceimpl.horsemanContrast();
        System.out.println(horsemanContrasts);
    }

    @Test
    public void testlatlon() {
        order order = orderMappers.selectOrderNumber("20200704110149395");
        String lat = order.getLat();
        String lon = order.getLon();
        System.out.println(lat);
        System.out.println(lon);
        double v;
        double v1;
        if (Strings.isBlank(lat) || Strings.isBlank(lon) || "0".equals(lat) || "0".equals(lon)) {
            v = 0.0;
            v1 = 0.0;
        } else {
            v = Double.parseDouble(lat) + 0.1;
            v1 = Double.parseDouble(lon) + 0.1;
        }

        System.out.println("v:" + v);
        System.out.println("v1:" + v1);
    }

    @Test
    public void testspring() {
        gzh userGzh = new gzh();
        userGzh.setId(3);
        userGzh.setOpenAppid("用户测试");
        userGzh.setAccessToken("111");
        userGzh.setExpiresIn(7200);
        gzhMapper.updateByPrimaryKeySelective(userGzh);
    }


    @Test
    public void testGetModuleId() {
        Map<String, Double> map = new HashMap<>();
        map.put("userLat", 23.033013);
        map.put("userLon", 113.76287);
        Map<String, Object> approachingHorseman = automaticSend.getApproachingHorseman(map);
        approachingHorseman.forEach((k, v) -> {
            System.out.println(k);
            System.out.println(v);

        });
    }

    @Test
    public void test() {
        Map<String, Double> map = getLngAndLat("广东省东莞市东莞市东莞莞城区元岭路97号合家欢");
        System.out.println("经度：" + map.get("lng") + "---纬度：" + map.get("lat"));
    }


    public static Map<String, Double> getLngAndLat(String address) {

        Map<String, Double> map = new HashMap<String, Double>();

        String url = "http://api.map.baidu.com/geocoder/v2/?address=" + address + "&output=json&ak=14fN9rWBjnBw4LGzGe7PVNtf";

        String json = loadJSON(url);

        JSONObject obj = JSONObject.fromObject(json);

        if (obj.get("status").toString().equals("0")) {
            double lng = obj.getJSONObject("result").getJSONObject("location").getDouble("lng");
            double lat = obj.getJSONObject("result").getJSONObject("location").getDouble("lat");
            map.put("lng", lng);
            map.put("lat", lat);
            //System.out.println("经度："+lng+"---纬度："+lat);
        } else {
            //System.out.println("未找到相匹配的经纬度！");
        }
        return map;
    }

    public static String loadJSON(String url) {
        StringBuilder json = new StringBuilder();
        try {
            URL oracle = new URL(url);
            URLConnection yc = oracle.openConnection();
            BufferedReader in = new BufferedReader(new InputStreamReader(
                    yc.getInputStream()));
            String inputLine = null;
            while ((inputLine = in.readLine()) != null) {
                json.append(inputLine);
            }
            in.close();
        } catch (MalformedURLException e) {
        } catch (IOException e) {
        }
        return json.toString();
    }


    @Test
    public void testorder() {
        List<String> openId = new ArrayList<>();
        openId.add("osdn25dtBEQ_Sx0yrH2dneMg5iFM");
        openId.add("osdn25Q5po2JEVJZF6OAEfr_FT_s");
        List<order> orders = orderMappers.selectPartnerOrder(openId);
        orders.forEach((v) -> {
            System.out.println(v);
        });
    }


    @Test
    public void testCode() {

//        user user = userMapper.selectMinDate();
//        user user1 = userMapper.selectNowDate();
//
//        Instant instant = user.getCreateTime().toInstant();
//        ZoneId zone = ZoneId.systemDefault();
//        LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zone);
//        LocalDate localDate = localDateTime.toLocalDate();
//        System.out.println("localDate:"+localDate);
//        System.out.println("当前时间:"+LocalDate.now());
//        long days = localDate.until(LocalDate.now(), ChronoUnit.DAYS);
//        System.out.println(days);
        for (int i = 0; i < 100; i++) {
            LocalDate now = LocalDate.now();
            LocalDate localDate = now.minusDays(i);
            System.out.println(localDate);
        }


//        List<List<orderItem>> a = new ArrayList<>();
//        for (int i=0;i<365;i++){
//            //List<order> yesterdayOrder2 = orderMappers.getYesterdayOrder2(i);
//            //List<user> yesterdayAdduser = userMapper.getYesterdayAdduser2(i);
//            List<orderItem> yesterdayOrderWeightAndMoneyAndProductType2 = orderItemMapper.getYesterdayOrderWeightAndMoneyAndProductType2(i);
//            a.add(yesterdayOrderWeightAndMoneyAndProductType2);
//        }
//        a.forEach((v)->{
//            v.forEach((k)->{
//                System.out.println(k);
//            });
//        });

    }

    @Test
    public void testData() {
        MyUtil.getActualDistance(40.01116, 116.339303, 39.936404, 116.452562);
    }


    @Test
    public void testDate() {
        Integer integer = userBindHorsemanService.bindHorsemanPhone("osdn25dtBEQ_Sx0yrH2", "13767599447");
        System.out.println(integer);
    }

    @Test
    public void testSpli() {
        user user = userMapper.selectFindOneUser("osdn25dtBEQ_Sx0yrH2dneMg5iFM");
        System.out.println(user);
    }

    public static int getResponseCode(String urlString) throws MalformedURLException, IOException {
        URL u = new URL(urlString);
        HttpURLConnection huc = (HttpURLConnection) u.openConnection();
        huc.setRequestMethod("GET");
        huc.connect();
        return huc.getResponseCode();
    }

    @Test
    public void testUrl() throws Exception {
        String url = "https://www.vaiq.cn:8181/dhn/icon/ewm/osdn25afdi654ru2pMYVtP1WN3aw.jpg";
        try {
            URL u = new URL(url);
            HttpURLConnection huc = (HttpURLConnection) u.openConnection();
            huc.setRequestMethod("HEAD");
            huc.setConnectTimeout(5000); //视情况设置超时时间
            huc.connect();
            int responseCode = huc.getResponseCode();
            if (responseCode == HttpURLConnection.HTTP_OK) {
                System.out.println("成功");// == HttpURLConnection.HTTP_OK
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("错误");
    }

    @Test
    public void testEven() {
        List<horseman> horsemen = horsemanMapper.selectHorsemanNumber("13767599447");
        if (!horsemen.isEmpty() || horsemen.size() > 0) {
            horsemen.forEach((v) -> {
                System.out.println(v);
            });
        } else {
            System.out.println("数据为空");
        }

    }

    @Test
    public void testprice() {
        List<horseman> horsemen = horsemanMapper.selectAllHorsemanLatAndLon();
        horsemen.forEach((v) -> {
            System.out.println(v.getHorsemanName() + "::" + v.getHorsemanType());
        });
        System.out.println("--------------------------");

        horsemen.stream().filter(s -> !s.getHorsemanType().equals(2)).forEach(System.out::println);

        System.out.println("--------------------------");
        horsemen.forEach((v) -> {
            System.out.println(v);
        });
    }


    @Test
    public void testFormwork() {
        WxMpInMemoryConfigStorage wxStorage = new WxMpInMemoryConfigStorage();
        wxStorage.setAppId("wx8153b9b18ebfa8eb");//appid
        wxStorage.setSecret("c8bf9f0c564f7f44a297054995e6eada");//appsecret
        WxMpService wxMpService = new WxMpServiceImpl();
        wxMpService.setWxMpConfigStorage(wxStorage);

        //2,推送消息
        WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder()
                .toUser("oFPgIw7MovwilW9q955Y7RHrT6CM")//要推送的用户openid
                .templateId("Onyu36Rkvjtzk9khxmafs0nztFaPKw20kstV4vuBkr4")//模版id
                .url("https://www.baidu.com/")//点击模版消息要访问的网址
                .build();
        //3,如果是正式版发送模版消息，这里需要配置你的信息
        templateMessage.addData(new WxMpTemplateData("first", "派单提醒", "#FF00FF"));
        templateMessage.addData(new WxMpTemplateData("keyword1", "有用户下单了，请及时派单", "#FF00FF"));
        templateMessage.addData(new WxMpTemplateData("keyword2", "aaaTest", "#FF00FF"));
        templateMessage.addData(new WxMpTemplateData("keyword4", "13767599447", "#FF00FF"));
        templateMessage.addData(new WxMpTemplateData("keyword5", "广东", "#FF00FF"));
        templateMessage.addData(new WxMpTemplateData("remark", "点击派单", "#FF00FF"));
        //        templateMessage.addData(new WxMpTemplateData("name", "value", "#FF00FF"));
        //                templateMessage.addData(new WxMpTemplateData(name2, value2, color2));

        //发起推送
        try {
            String msg = wxMpService.getTemplateMsgService().sendTemplateMsg(templateMessage);
            System.out.println("推送成功：" + msg);
        } catch (Exception e) {
            System.out.println("推送失败：" + e.getMessage());
            e.printStackTrace();
        }
    }

    @Test
    public void testsfapi() throws UnsupportedEncodingException {
        String CLIENT_CODE = "HHMne8SCo9";  //此处替换为您在丰桥平台获取的顾客编码
        String CHECK_WORD = "zdD8Vyiqr8PRCUuWwQ3rLtf6aqSKAZJl";//此处替换为您在丰桥平台获取的校验码
        //沙箱环境的地址 -PRO
        String CALL_URL_BOX = "https://sfapi-sbox.sf-express.com/std/service";
        //生产环境的地址 -PRO
        //String CALL_URL_PROD = "https://sfapi.sf-express.com/std/service";
        IServiceCodeStandard testService = ExpressServiceCodeEnum.EXP_RECE_CREATE_ORDER; //下订单
        CallExpressServiceTools client = CallExpressServiceTools.getInstance();
        // set common header
        Map<String, String> params = new HashMap<String, String>();
        String timeStamp = String.valueOf(System.currentTimeMillis());
        String msgData = client.packageMsgData(testService);

        params.put("partnerID", CLIENT_CODE);  // 顾客编码 ，对应丰桥上获取的clientCode
        params.put("requestID", UUID.randomUUID().toString().replace("-", ""));
        params.put("serviceCode", testService.getCode());// 接口服务码
        params.put("timestamp", timeStamp);
        params.put("msgData", msgData);
        params.put("msgDigest", client.getMsgDigest(msgData, timeStamp, CHECK_WORD));

        // System.out.println(params.get("requestID"));
        long startTime = System.currentTimeMillis();

        System.out.println("====调用请求：" + params.get("msgData"));
        String result = HttpClientUtil.post(CALL_URL_BOX, params);

        System.out.println("====调用丰桥的接口服务代码：" + String.valueOf(testService.getCode()) + " 接口耗时：" + String.valueOf(System.currentTimeMillis() - startTime) + "====");
        System.out.println("===调用地址 ===" + CALL_URL_BOX);
        System.out.println("===顾客编码 ===" + CLIENT_CODE);
        System.out.println("===返回结果：" + result);
    }

    @Test
    public void testfil() throws IOException {
        String jsonString = "";
        try {
            ClassPathResource classPathResource = new ClassPathResource("/json/ExpressJson/1.order.txt");
            InputStream inputStream = classPathResource.getInputStream();

            File file = ResourceUtils.getFile("classpath:1.order.txt");
            //InputStream is = this.getClass().getResourceAsStream(file);
            InputStream is = new FileInputStream(file);
            byte[] bs = new byte[is.available()];
            is.read(bs);
            jsonString = new String(bs);
        } catch (Exception var4) {
            System.out.println(var4.fillInStackTrace());
        }

    }

    private static void JsonToMap(Stack<org.json.JSONObject> stObj, Map<String, Object> resultMap)  throws  IOException {

        if(stObj == null && stObj.pop() == null){
            return ;
        }
        org.json.JSONObject json = stObj.pop();
        Iterator it = json.keys();
        while(it.hasNext()){
            String key = (String) it.next();
            //得到value的值
            Object value = json.get(key);
            //System.out.println(value);
            if(value instanceof JSONObject)
            {
                stObj.push((org.json.JSONObject)value);
                //递归遍历
                JsonToMap(stObj,resultMap);
            }
            else {
                resultMap.put(key, value);
            }
        }
    }


    @Test
    public void testjson() throws IOException {
        String jsons = "{\n" +
                "\t\"Body\": {\n" +
                "\t\t\"WaybillRoute\": [\n" +
                "\t\t\t{\n" +
                "\t\t\t\t\"acceptAddress\": \"\\u4e1c\\u839e\\u5e02\",\n" +
                "\t\t\t\t\"mailno\": \"SF1330427011416\",\n" +
                "\t\t\t\t\"orderid\": \"211112103943\",\n" +
                "\t\t\t\t\"acceptTime\": \"2021-11-12 16:05:52\",\n" +
                "\t\t\t\t\"remark\": \"\\u5feb\\u4ef6\\u5230\\u8fbe \\u3010\\u4e1c\\u839e\\u5357\\u57ce\\u5e7f\\u5b87\\u5927\\u53a6\\u8425\\u4e1a\\u70b9\\u3011\",\n" +
                "\t\t\t\t\"opCode\": \"31\",\n" +
                "\t\t\t\t\"id\": \"163670462592073\"\n" +
                "\t\t\t}\n" +
                "\t\t]\n" +
                "\t}\n" +
                "}";

        JSONObject jsonObject =JSONObject.fromObject(jsons);

        JSONObject json =jsonObject.getJSONObject("Body");

        JSONArray A1 =json.getJSONArray("WaybillRoute");


       // sforder sforder = new sforder();

        JSONObject jsonObject2 =A1.getJSONObject(0);

        String acceptAddress=jsonObject2.get("acceptAddress").toString();

        String orderid=jsonObject2.get("orderid").toString();

        String acceptTime=jsonObject2.get("acceptTime").toString();

        String remark=jsonObject2.get("remark").toString();

        System.out.println("acceptAddress：="+acceptAddress);


    }


    @Test
    public void testjson2() throws IOException {
        String jsons ="{\n" +
                "\t\"requestId\": \"734FE61CBED645CDBB79C7F0D2EC2214\",\n" +
                "\t\"timestamp\": 1636770198769,\n" +
                "\t\"orderState\": [\n" +
                "\t\t{\n" +
                "\t\t\t\"lastTime\": \"\",\n" +
                "\t\t\t\"orderNo\": \"211113102315\",\n" +
                "\t\t\t\"empPhone\": \"189***67\",\n" +
                "\t\t\t\"netCode\": \"769AO\",\n" +
                "\t\t\t\"createTm\": \"2021-11-13 10:23:18\",\n" +
                "\t\t\t\"empCode\": \"40574165\",\n" +
                "\t\t\t\"carrierCode\": \"SF\",\n" +
                "\t\t\t\"orderStateDesc\": \"\\u4e0b\\u5355\\u5df2\\u63a5\\u6536\",\n" +
                "\t\t\t\"bookTime\": \"\",\n" +
                "\t\t\t\"orderStateCode\": \"04-40037\",\n" +
                "\t\t\t\"waybillNo\": \"SF1330959103732\"\n" +
                "\t\t}\n" +
                "\t]\n" +
                "}";

        JSONObject jsonObject =JSONObject.fromObject(jsons);
        System.out.println("json="+jsons);
        System.out.println("jsonObject="+jsonObject);

        JSONArray jsonArray1=jsonObject.getJSONArray("orderState");

        JSONObject jsonObject2 =jsonArray1.getJSONObject(0);
        String asd=jsonObject2.get("orderStateDesc").toString();
        System.out.println(asd);

    }


    @Test
    public void testsf1() throws IOException {
        String a="80";
        if(a=="80"||a=="8000"){
            System.out.println("试试");
        }else{
            System.out.println("神马都没有");
        }

    }



    @Test
    public void cancelOrder() {
        order order = new order();
        order.setOrderState("待派单");
        if (1 == 1) {
            log.debug("开始推送");
            //推送消息给管理员，提醒派单
            //1，配置
            WxMpInMemoryConfigStorage wxStorage = new WxMpInMemoryConfigStorage();
            wxStorage.setAppId("wx8153b9b18ebfa8eb");
            wxStorage.setSecret("c8bf9f0c564f7f44a297054995e6eada");
            String token = gzhMapper.selectByPrimaryKey(3).getAccessToken();
            wxStorage.setAccessToken(token);

            WxMpService wxMpService = new WxMpServiceImpl();
            wxMpService.setWxMpConfigStorage(wxStorage);

            // 主要是这里， 设置小程序的appid和转发的页面
//            TreeMap<String, String> miniprograms = new TreeMap<String, String>();
//            miniprograms.put("appid","小程序的appid");
//            miniprograms.put("pagepath","pages/index/index?temp=1");// 注意，这里是支持传参的！！！
            WxMpTemplateMessage.MiniProgram miniProgram = new WxMpTemplateMessage.MiniProgram();
            miniProgram.setAppid("wx51d55df222d9901e");
            miniProgram.setPagePath("pages/sendOrder/main?id=" + 101);
            //2,推送消息
            WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder()
                    .toUser("osdn25R_shT_SITML7BOTrLTith4")//要推送的用户openid
                    .templateId("Xc_tnHReR3n1X91cwATTFitTJwgKDGn2YRhpygiA53U")//模版id
                    .url("https://www.baidu.com")
                    .build();
            templateMessage.setMiniProgram(miniProgram);
            //3,如果是正式版发送模版消息，这里需要配置你的信息
            templateMessage.addData(new WxMpTemplateData("first", "测试提醒", "#FF00FF"));
            templateMessage.addData(new WxMpTemplateData("keyword1", "测试派单", "#FF00FF"));
            templateMessage.addData(new WxMpTemplateData("keyword2", "测试", "#FF00FF"));
            templateMessage.addData(new WxMpTemplateData("keyword4", "13888888888", "#FF00FF"));
            templateMessage.addData(new WxMpTemplateData("keyword5", "测试测试33", "#FF00FF"));
            templateMessage.addData(new WxMpTemplateData("remark", "点击派单", "#FF00FF"));
            //templateMessage.addData(new WxMpTemplateData("name2", value2, color2));
            try {
                wxMpService.getTemplateMsgService().sendTemplateMsg(templateMessage);
            } catch (Exception e) {
                System.out.println("推送失败：" + e.getMessage());
                e.printStackTrace();
            }

        }

    }

    @Test
    public void dbdemo1() throws UnsupportedEncodingException {

        // long timestamp = 1620445488208L;
        String[] lists = new String[]{"DPK380019980303","DPK380019980304"};

        String json="{ \n" +
                "   \"companyCode\":\"EWBSTHBKJG\",    \"custOrderNo\":\"2021113005\",    \"customerCode\":\"863038974\",    \"logisticID\":\"GWDE1234567892\",    \"needTraceInfo\":1,    \"orderType\":\"1\",  \n" +
                "  \"packageInfo\":{        \"cargoName\":\"旧衣服\",        \"deliveryType\":\"3\",        \"totalNumber\":2,        \"totalVolume\":0.01,        \"totalWeight\":1,        \"packageService\":\"纤\"    },   \n" +
                " \"receiver\":{        \"address\":\"广东省东莞市宏伟二路与绿色路交叉口西南方向50米\",        \"city\":\"东莞市\",              \"county\":\"南城区\",        \"mobile\":\"13480031813\",        \"name\":\"大黄牛\",        \"province\":\"广东\",        \"town\":\"宏伟二路\"    }, \n" +
                " \"sender\":{        \"address\":\"广东省东莞市G1峰汇2607\",        \"city\":\"东莞市\",            \"county\":\"南城区\",        \"mobile\":\"17674645466\",        \"name\":\"AAA\",        \"province\":\"广东\",        \"town\":\"宏图路\"    }, \n" +
                " \"transportType\":\"ZBTH\",    \"gmtCommit\":\"2021-11-30 14:00:19\",    \"payType\":\"2\",    \"isOut\":\"N\"}";

        //String tojson=JSON.toJSONString(json);
        System.out.println(json);

        String companyCode ="EWBSTHBKJG";
        String appkey ="cc20e8ce81058dd70e27795cc9754424";
        String response = DBUtils.postHttp("http://dpsanbox.deppon.com/sandbox-web/dop-standard-ewborder/createOrderNotify.action", json, companyCode, appkey);


        System.out.println(response);

/*        for (String list : lists) {
            TraceScri traceScri = new TraceScri();
            traceScri.setTracking_number(list);
            String params = JSON.toJSONString(traceScri);
//        System.out.println(Base64.class.getProtectionDomain().getCodeSource().getLocation());
//        String digest = getDigest(params + "4fba9166f5fc18040ff09accb005f3f1" + timestamp);
            String companyCode ="EWBSTHBKJG";
            String appkey ="cc20e8ce81058dd70e27795cc9754424";
            String response = DBUtils.postHttp("http://dpsanbox.deppon.com/sandbox-web/dop-standard-ewborder/createOrderNotify.action", params, companyCode, appkey);

       //     System.out.println(response);
        }*/

    }




}